﻿using System;
using System.Collections.Generic;

namespace roster.Domain
{
    public enum Class
    {
        Warrior,
        Rogue,
        Druid,
        Shaman,
        Mage,
        Warlock,
        Priest,
        Hunter,
        Paladin
    }
    
    public static class ClassNameToEnum
    {
    	static ClassNameToEnum()
    	{
    		m_ClassToEnumDict.Add("Warrior", Class.Warrior);
    		m_ClassToEnumDict.Add("Rogue", Class.Rogue);
    		m_ClassToEnumDict.Add("Druid", Class.Druid);
    		m_ClassToEnumDict.Add("Shaman", Class.Shaman);
    		m_ClassToEnumDict.Add("Mage", Class.Mage);
    		m_ClassToEnumDict.Add("Warlock", Class.Warlock);
    		m_ClassToEnumDict.Add("Priest", Class.Priest);
    		m_ClassToEnumDict.Add("Hunter", Class.Hunter);
    		m_ClassToEnumDict.Add("Paladin", Class.Paladin);
    		
    	}
    	
    	public static Class GetEnum(string name)
    	{
    		if (m_ClassToEnumDict.ContainsKey(name) == false)
    			throw new Exception(string.Format("Bad class name ({)})", name));
    		return m_ClassToEnumDict[name];
    	}
    	
    	private static Dictionary<string, Class> m_ClassToEnumDict = 
    		new Dictionary<string, Class>();
    }
    	
}